<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
function FloatAdd(arg1,arg2){
	var r1,r2,m;
	try{
		alert('Hi');
		r1=arg1.toString().split(".")[1].length;
	}catch(e){
		r1=0;
	};
	try{
		r2=arg2.toString().split(".")[1].length;
	}catch(e){
		r2=0;
	};
	m=Math.pow(10,Math.max(r1,r2));
	alert((arg1*m+arg2*m)/m);  
}
function IsDate(sm,mystring){
	var reg = /^(\d{4})-(\d{2})-(\d{2})$/;
	var str = mystring;
	var arr = reg.exec(str);
	if(str=="")
		return true;
	if(!reg.test(str)&&RegExp.$2<=12&&RegExp.$3<=31){
		alert("请保证"+sm+"中输入的日期格式为yyyy-mm-dd或正确的日期!");
		return false;
	}
	return true;
}
</script>
</head>
<body>
<form action="DeleteFile.do">
	文件名：<input type="text" name="name" value="abc.txt">
	<input type="submit" value="确定">
</form>
	<input type="button" value="验证" onclick="IsDate(1,'2001-02-02');">
	<input type="button" value="求和" onclick="FloatAdd('100.2','10.23');">	
	<a href="fileDownLoadServlet?filename=test.html">哈哈，测试文件下载</a>
</body>
</html>